package com.ponhu.ea2.goodsCenter.provider.service.impl;

import com.baomidou.dynamic.datasource.annotation.DS;
import com.ponhu.ea2.goodsCenter.provider.config.DBSourceConfig;
import com.ponhu.ea2.goodsCenter.provider.mapper.GoodsDataSyncMapper;
import com.ponhu.ea2.goodsCenter.provider.service.PonHuGoodsDataService;
import com.ponhu.ea2.query.GoodsDataSyncQuery;
import com.ponhu.ea2.vo.GoodsDataAttributeSyncVo;
import com.ponhu.ea2.vo.GoodsDataStockSyncVo;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * 查询胖总管数据接口
 * @author zhaokai
 */
@Slf4j
@Service
public class PonHuGoodsDataServiceImpl implements PonHuGoodsDataService {


    @Resource
    GoodsDataSyncMapper goodsDataSyncMapper;

    @DS(DBSourceConfig.PONHU_DB)
    @Override
    public List<GoodsDataAttributeSyncVo> selectPhGoodsAttributeData(GoodsDataSyncQuery goodsDataSyncQuery) {
        return goodsDataSyncMapper.selectPhGoodsAttributeData(goodsDataSyncQuery);
    }

    /**
     * 查询胖总管库存状态
     * @param goodsDataSyncQuery
     * @return
     */
    @DS(DBSourceConfig.PONHU_DB)
    @Override
    public List<GoodsDataStockSyncVo> selectPhGoodsStockData(GoodsDataSyncQuery goodsDataSyncQuery){
       return goodsDataSyncMapper.selectPhGoodsStockData(goodsDataSyncQuery);
    }
}
